package net.wenku8.reader.model.book;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import com.thoughtworks.xstream.annotations.XStreamConverter;
import com.thoughtworks.xstream.annotations.XStreamImplicit;
import com.thoughtworks.xstream.converters.extended.ToAttributedValueConverter;

import java.util.List;

/**
 * xml结构太混乱，volume中的title和chapter只能分开解析
 */
@XStreamAlias("volume")
@XStreamConverter(value= ToAttributedValueConverter.class, strings={"title"})
public class Volume2 {
    @XStreamAsAttribute
    String vid;
    String title;
    @XStreamImplicit
    @XStreamAlias("chapter")
    List<Chapter> chapterList;

    public String getVid() {
        return vid;
    }

    public void setVid(String vid) {
        this.vid = vid;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public List<Chapter> getChapterList() {
        return chapterList;
    }

    public void setChapterList(List<Chapter> chapterList) {
        this.chapterList = chapterList;
    }
}
